import './style/element_visiable.scss'
import 'element-plus/theme-chalk/dark/css-vars.css'
import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// 引入Gin-Vue-Admin前端初始化相关内容

// 引入封装的router
import router from '@/router/index'
import '@/permission'
import run from '@/core/Gin-Vue-Admin.js'
import auth from '@/directive/auth'
import { store } from '@/pinia'
import App from './App.vue'
// 消除警告
import 'default-passive-events'
const app = createApp(App)
app.config.productionTip = false

function setRem() {
  const baseSize = 16 // 基准大小，单位为px
  const scale = document.documentElement.clientWidth / 1920 // 以1920宽度为基准
  document.documentElement.style.fontSize = baseSize * Math.min(scale, 2) + 'px'
}
setRem()
// 改变窗口大小时重新设置rem基准值
window.onresize = function () {
  setRem()
}

app.use(run).use(ElementPlus).use(store).use(auth).use(router).mount('#app')
export default app
